/**
 * Created by liyigang on 13/6/2019.
 */
var changTabs = document.getElementById('change-tabs')

var img1Active = changTabs.children[0].getAttribute('data-active')
changTabs.children[0].setAttribute('src' , img1Active)

for(let i = 0;i < changTabs.children.length; i++) {
    changTabs.children[i].addEventListener('click' , function(e){
        for(let i = 0;i < changTabs.children.length; i++) {
            let showTable = 't-' + changTabs.children[i].getAttribute('data-table')
            let tableDom = document.getElementById(showTable)
            tableDom.style.display = 'none'
            let initBtn = changTabs.children[i].getAttribute('data-unactive')
            changTabs.children[i].setAttribute('src' , initBtn)
        }
        let changeActiveBtn = this.getAttribute('data-active')
        this.setAttribute('src' , changeActiveBtn)

        let showTable = 't-' + changTabs.children[i].getAttribute('data-table')
        let tableDom = document.getElementById(showTable)
        tableDom.style.display = 'block'
    })
}